/**
 * Copyright 2009 Wisdom
 */
package com.wisdom.model.dao.hibernate;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.wisdom.model.dao.PostDao;
import com.wisdom.model.entities.Category;
import com.wisdom.model.entities.Keyword;
import com.wisdom.model.entities.Post;
import com.wisdom.model.entities.User;

/**
 * Data access object for work with Posts via hibernate
 * 
 * @author alekseiko
 * @since 1.0
 */
@Transactional
@Repository("postDao")
public class HibernatePostDao implements PostDao {
        
    @Resource
    private HibernateTemplate template;

    /**
     * {@inheritDoc}
     */
    public Post getPost(final long id) {	
	return template.load(Post.class, id);
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPosts() {	
	return template.loadAll(Post.class);
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPosts(final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByCategories(final List<Category> categories) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByCategories(final List<Category> categories,
	    final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByFragment(final String fragment) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByFragment(final String fragment, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByFragment(final String fragment,
	    final List<Category> categories) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByFragment(final String fragment,
	    final List<Category> categories, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByKeywords(final List<Keyword> keywords) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByKeywords(final List<Keyword> keywords,
	    final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByKeywords(final List<Keyword> keywords,
	    final List<Category> categories) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByKeywords(final List<Keyword> keywords,
	    final List<Category> categories, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByPostedDate(final Date posted) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByPostedDate(final Date posted, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByPostedDate(final Date posted,
	    final List<Category> categories) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByPostedDate(final Date posted,
	    final List<Category> categories, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByUsers(final List<User> users) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByUsers(final List<User> users, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByUsers(final List<User> users, final List<Category> categories) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public List<Post> getPostsByUsers(final List<User> users,
	    final List<Category> categories, final boolean commented) {
	return null;
    }

    /**
     * {@inheritDoc}
     */
    public void remove(Post post) {
	template.delete(post);
    }

    /**
     * {@inheritDoc}
     */
    public void save(Post post) {
	template.saveOrUpdate(post);
    }

}
